<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>
  var promise = function () {
    return new Promise(function(resolve, reject) {
      setTimeout(() => {
        resolve("promise")
      }, 2000);
    })
  }
  function p2() {
    return new Promise(function (resolve, reject) {
      resolve("p2")
    })
  }

  Promise.all(["a", "b", promise(), p2(), "c"]).then(res => {
    console.log(res)
  })


  // promise.then().then().then(res => {
  //   console.log(res)
  // })




  </script>
</body>
</html>